package com.infoholdcity.common.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 查询条件数据表
 * </p>
 *
 * @author jinshihui
 * @since 2025-02-20
 */
@Getter
@Setter
@TableName("query_conditions_data")
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties({"id","mainId","createTime","creator","updateTime","updator","optionss"})
public class QueryConditionsData implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId("id")
    private String id;

    /**
     * 外键ID
     */
    @TableField("main_id")
    private String mainId;

    /**
     * 字段名称
     */
    @TableField("field_name")
    private String fieldName;

    /**
     * 字段值
     */
    @TableField("field_value")
    private String fieldValue;

    /**
     * 规则
     */
    @TableField("rule")
    private String rule;

    /**
     * 组件类型
     */
    @TableField("component_type")
    private String componentType;

    /**
     * 下拉列表选项（JSON格式）
     */
    @TableField("options")
    private String optionss;

    @TableField(exist = false)
    private List<Option> options;

    @Data
    public static class Option {
        private String value;
        private String text;
    }

    /**
     * 创建时间
     */
    @TableField(value = "create_time",fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 创建者
     */
    @TableField(value = "creator",fill = FieldFill.INSERT)
    private String creator;

    /**
     * 更新时间
     */
    @TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    /**
     * 更新者
     */
    @TableField(value = "updator",fill = FieldFill.INSERT_UPDATE)
    private String updator;
}
